<%- include('./templates/_header') %>
    <div id="container" class="container release-post-container">
        <form class="release-form" id="release-form" action="/article/add" method="post" enctype="multipart/form-data">
            <input type="hidden" value="<%= category._id %>" name="category">
            <input type="hidden" value="<%= category.slug %>" name="category_slug">
            <div class="release-post">
            <div class="weui_cell first">
                <div class="weui_cell_hd"><label class="weui_label">标题:</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" placeholder="请输入标题" type="text" name="title" required minlength="2" maxlength="20" oninvalid="$.toptips('标题太少，再多写点！')" />
                </div>
            </div>

            <div class="weui_cell weui_cell_textarea">
                <div class="weui_cell_hd"><label class="weui_label">描述:</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                   <textarea id="textarea" class="weui_textarea" placeholder="请输入描述" rows="5" required minlength="4" maxlength="300" oninvalid="$.toptips('描述太少，再多写点！')" name="body" ></textarea>
                   <div class="weui_textarea_counter"><span id='count'>0</span>/<span id='count_max'>300</span></div>
                </div>
            </div>

            <div class="weui_cell weui_cell_upload">
                <div class="weui_cell_bd weui_cell_primary">
                    <div class="weui_uploader">
                        <div class="weui_uploader_hd weui_cell">
                            <div class="weui_cell_bd weui_cell_primary">添加图片:</div>
                            <div class="weui_cell_ft">0/3</div>
                        </div>
                        <div class="weui_uploader_bd">
                            <div class="weui_uploader_input_wrp">
                                <input class="weui_uploader_input" type="file" name="photo" />
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <% if(category.slug != 'wt') { %>
                <div class="weui_cell">
                    <div class="weui_cell_hd"><label class="weui_label weui_label_long">联系人:</label></div>
                    <div class="weui_cell_bd weui_cell_primary">
                        <input class="weui_input" type="text" placeholder="请输入联系人" type="text" name="contact_name" required minlength="2" maxlength="6" pattern="^[\u4e00-\u9fa5]{0,}$" oninvalid="$.toptips('请正确填写联系人姓名！')" />
                    </div>
                </div>
                <div class="weui_cell">
                    <div class="weui_cell_hd"><label class="weui_label weui_label_long">联系电话:</label></div>
                    <div class="weui_cell_bd weui_cell_primary">
                        <input class="weui_input" type="tel" placeholder="请输入联系电话" type="text" name="contact_phone" required minlength="11" maxlength="11" pattern="^1[3-9]\d{9}$" oninvalid="$.toptips('请正确填写联系人电话！')"/>
                    </div>
                </div>
                <div class="weui_cell weui_cells_area last">
                    <div class="weui_cell_hd"><label for="" class="weui_label weui_label_long">所在省市:</label></div>
                    <div class="weui_cell_bd weui_cell_primary">
                        <input class="weui_input" type="text"  name="area" id='chooseCity' required  oninvalid="$.toptips('请正确填写需求所在城市！')"/>
                        <i class="jt"></i>
                    </div>
                </div> 
            <% } %>
            <input type="submit" id="release-submit" class="weui_btn bg-blue" value="发布" />
        </form>
    </div>
    <script src="/lib/picker/picker.js"></script>
    <script src="/lib/picker/picker-city.js"></script>
    <script type="text/javascript" src="/js/release.js"></script>
<%- include('./templates/_footer') %>